POV-Ray : Newsgroups : povray.unofficial.patches : Glows are not translated with the light source : Re: Glows are not translated with the light source Server Time
2 Sep 2024 02:12:33 EDT (-0400)
  Re: Glows are not translated with the light source  
From: Warp
Date: 11 Nov 2000 07:53:13
Message: <3a0d4139@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: Nope, transformations just push the location(s) around, the shape of the 
: glow effect won't change.

  Why not? Wouldn't it be possible to apply the inverse transformation to
the testing ray, exactly as with objects?

: The STL? But POV isn't written in C++(yet), so I can't use those.

  AFAIK pov3.5 will use some C++.

: Besides, I still hate templates.

  Why? They are extremely useful.

  The ONLY way of making a class which you can say "make an array which
contains this type of objects" is using a template.
  The only other option is to inherit your objects from a base class and
tell to the class to store base class-type _pointers_ pointing to
dynamically allocated instances. It would not be an array anymore with its
memory saving properties.

  What's so bad about templates?
  The only bad thing I can imagine about them is that you get sometimes
quite long error messages, but that's all.

: There *has* to be a better way of doing 
: the same thing...why did they do it this way?

  A better way? In my opinion templates are the best way. They are easy
to use and extremely powerful. They help you writing simple code (both
in the template implementation and the code where the template is used)
without the need of any low-level tricks which are hard to write and
understand.
  They also help you avoiding code repetition. It's fool to write three
times the same code for three different item types when you can write
it only once and let the compiler do the work.

  Sometimes you don't even know that you are using a template.
  Have you ever used the string class in C++? Well, let me tell you something:
The string class is, surprise surprise, a template class.
  That's the power of templates. Some times you don't even have to know that
it is a template when you use it.
  You can, for example, write something like this:

int table[10] = { .... };
sort(table, table+10);

  The sort-function is, surprise surprise, a template function.

: Though I can't imagine why one would want to perform a binary search on 
: glows, or what characteristics they would be sorted by...

  Location with respect to the camera?
  It doesn't help with reflections and refractions, but when the glow is
directly seen from the camera, if all the glows are sorted you could use
some binary search to find the correct glows to test a lot faster.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.